<style scoped lang="less">
.page-index {
  overflow: auto;
}
.page-box {
  text-align: center;
  margin: 20px auto;
}
</style>
<template>
    <div class="page-index">
        <i-table stripe  border  :columns="columns" :data="data"></i-table>
    </div>
</template>
<script>
export default {
  data() {
    return {
      self: this,
      pageIndex: 0,
      pageSize: 10,
      pageTotal: 0,
      columns: [
        {
          title: "节目名称",
          key: "title"
        },
        {
          title: "票数",
          key: "vote"
        }
      ],
      data: []
    };
  },
  created() {
    var self = this;
    self.init();
  },
  methods: {
    init() {
      var self = this;

      var req = this.Axios.get(this.Interface.actList, {
        params: {
          pageIndex: this.pageIndex,
          pageSize: this.pageSize
        }
      });

      req.then(res => {
        var data = res.data;
        console.log(data);
        if (data.success) {
          var count = data.data.count;
          this.pageTotal = count;
          this.data = data.data.rows;
        } else {
          this.$Message.error(data.msg);
        }
      });
    }
  }
};
</script>
